package com.huluobo.high3demo.startLive;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;

import com.huluobo.mvvm.baen.PushBeanResult;
import com.huluobo.mvvm.baen.StopPushBeanResult;
import com.huluobo.mvvm.viewmodel.BaseViewModel;

/**
 * Created by LC on 2023/9/27.
 */
public class StartLiveViewModel extends BaseViewModel<StartLiveRepo> {
    MutableLiveData<PushBeanResult> pushSuccess = new MutableLiveData<>();

    MutableLiveData<String> pushFailed = new MutableLiveData<>();

    MutableLiveData<StopPushBeanResult> stopPushSuccess = new MutableLiveData<>();

    MutableLiveData<String> stopPushFailed = new MutableLiveData<>();

    public void push(String address, String caption) {
        repo.startPush(address, caption, pushSuccess, pushFailed);
    }

    public void stopPush() {
        repo.stopPush(stopPushSuccess, stopPushFailed);
    }

    public StartLiveViewModel(@NonNull Application application) {
        super(application);
    }

    @Override
    protected StartLiveRepo createRepo() {
        return new StartLiveRepo();
    }
}
